package uskg.kotoriforest.enumtest;

import java.util.Scanner;

//interface IWeek {
//    void showWeek();
//}
public enum Week {
    MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;

//    @Override
//    public void showWeek() {
//        System.out.println("Week::showWeek()");
//    }
}

class TestEnumMethod {
    public static void main(String[] args) {
        //values()
        Week[] values = Week.values();
        for (Week value : values) {
            //ordinal()、name()
            System.out.println((value.ordinal() + 1) + "->" + value.name());
        }
        System.out.println("------------------------");
        Scanner input = new Scanner(System.in);
        System.out.print("请输入星期值：");
        int weekValue = input.nextInt();
        Week week = values[weekValue - 1];
        //toString()
        System.out.println(week);
        System.out.print("请输入星期名：");
        String weekName = input.next();
        //valueOf()
        week = Week.valueOf(weekName);
        System.out.println(week);
        input.close();
    }
}

//class TestWeek {
//    public static void main(String[] args) {
//        Week week = Week.MONDAY;
//        System.out.println(week.getClass());
//        System.out.println(week.getClass().getSuperclass());
//        System.out.println(week.getClass().getSuperclass().getSuperclass());
//        switch (week) {
//            case Week.MONDAY:
//                System.out.println("MONDAY");
//                break;
//            case TUESDAY:
//                System.out.println("TUESDAY");
//                break;
//            case WEDNESDAY:
//                System.out.println("WEDNESDAY");
//                break;
//            case THURSDAY:
//                System.out.println("THURSDAY");
//                break;
//            case FRIDAY:
//                System.out.println("FRIDAY");
//                break;
//            case SATURDAY:
//                System.out.println("SATURDAY");
//                break;
//            case SUNDAY:
//                System.out.println("SUNDAY");
//                break;
//            default:
//                break;
//        }
//    }
//}

enum Person {
    MAN, WOMAN;

    enum Age {

    }
}